package de.hsb.ai.agent.misterstar;

import de.hsb.ai.util.map.ScotlandJadeMapHelper.ScotlandJadeVertex;

public class MisterStarNode {
	
	private ScotlandJadeVertex node = null;
	private MisterStarNode parent = null;
	private double 	bestH = -1;
	private int		bestIndex = -1;
	private double 	nextBestH = -1;
	private int		nextBestIndex = -1;
	private double 	gonePath = 0;
	private int		nodeCount = 0;
	
	public MisterStarNode(ScotlandJadeVertex node) {
		this.node = node;
	}
	public ScotlandJadeVertex getNode() {
		return node;
	}

	public void setNode(ScotlandJadeVertex node) {
		this.node = node;
	}

	public double getBestH() {
		return bestH;
	}

	public void setBestH(double bestH) {
		this.bestH = bestH;
	}

	public int getBestIndex() {
		return bestIndex;
	}

	public void setBestIndex(int bestIndex) {
		this.bestIndex = bestIndex;
	}

	public double getNextBestH() {
		return nextBestH;
	}

	public void setNextBestH(double nextBestH) {
		this.nextBestH = nextBestH;
	}

	public int getNextBestIndex() {
		return nextBestIndex;
	}

	public void setNextBestIndex(int nextBestIndex) {
		this.nextBestIndex = nextBestIndex;
	}
	
	public void switchH()
	{
//		double tempnext = nextBestH;
//		int tempindex = nextBestIndex;
		bestH = nextBestH;
		bestIndex = nextBestIndex;
		nextBestH = 10000;
		nextBestIndex = 10000;
//		nextBestH = bestH;
//		nextBestIndex = bestIndex;
//		bestH = tempnext;
//		bestIndex = tempindex;
	}

	public void setGonePath(double gonePath) {
		this.gonePath = gonePath;
	}
	public double getGonePath() {
		return gonePath;
	}
	
	public String toString() {
		return "("+node.getIndex()+" -> "+bestIndex+"("+Math.round(bestH)+"),"+nextBestIndex+"("+Math.round(nextBestH)+"))\n";
	}
	public void setNodeCount(int nodeCount) {
		this.nodeCount = nodeCount;
	}
	public int getNodeCount() {
		return nodeCount;
	}
	public void setParent(MisterStarNode parent) {
		this.parent = parent;
	}
	public MisterStarNode getParent() {
		return parent;
	}
}
